#  Automake file for the Fixmath library.

#  Copyright (C) 2005-2011, Axis Communications AB, LUND, SWEDEN
#
#  This file is part of Fixmath.
#
#  Fixmath is free software: you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License as published
#  by the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#  You can use the comments under either the terms of the GNU Lesser General
#  Public License version 3 as published by the Free Software Foundation,
#  either version 3 of the License or (at your option) any later version, or
#  the GNU Free Documentation License version 1.3 or any later version
#  published by the Free Software Foundation; with no Invariant Sections, no
#  Front-Cover Texts, and no Back-Cover Texts.
#  A copy of the license is included in the documentation section entitled
#  "GNU Free Documentation License".
#
#  Fixmath is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU Lesser General Public License for more details.
#
#  You should have received a copy of the GNU Lesser General Public
#  License and a copy of the GNU Free Documentation License along
#  with Fixmath. If not, see <http://www.gnu.org/licenses/>.

# Tell aclocal to search the m4 directory
ACLOCAL_AMFLAGS = -I m4

# The subdirectories to build
SUBDIRS = src checktests

# Also distribute the prof directory
DIST_SUBDIRS = $(SUBDIRS) prof

# Install all headers in a fixmath subdirectory
fx_includedir = $(includedir)/fixmath

# Install also the pkg-config data file
pkgconfigdir   = ${libdir}/pkgconfig
pkgconfig_DATA = fixmath.pc

# The API headers to install
fx_include_HEADERS = include/fixmath.h         \
                     include/fixmath_ver.h     \
                     include/fixmath_export.h  \
                     include/fixmath_arch.h    \
                     include/fixmath_impl.h    \
                     include/fixmath_macro.h

# ----------------------------------------------------
#  Rule section
# ----------------------------------------------------

if HAVE_DOXYGEN

# Generate documentation on 'all' target
all-local html-local: doxygen.tag

# Install documentation hook
install-html-local: install-doxygen-html

# Uninstall documentation hook
uninstall-local: uninstall-doxygen-html

# Remove all files generated by Doxygen on 'clean'
clean-local-doxy:
	rm -rf doxygen.tag doxygen.out

# Also distribute doxygen files
dist-local:
	cp -a $(srcdir)/doxygen $(distdir)

# Generate all doxygen documentation
doxygen.tag: Doxyfile $(fx_include_HEADERS)
	@DOXYGEN@ Doxyfile

# Install all generated html pages
install-doxygen-html: doxygen.tag
	$(mkdir_p) $(htmldir)
	$(INSTALL_DATA) doxygen.out/html/* $(htmldir)

# Uninstall all generated html pages
uninstall-doxygen-html:
	rm -rf $(htmldir)

endif
